#include<iostream>
#include<pthread.h>
#include<unistd.h>
using namespace std;

void* fun(void* args)
{
	while(1){
		cout<<"我是新线程 "<< "  "<<pthread_self()<<endl;
		sleep(1);
	}
}
int main()
{
	pthread_t id;
	pthread_create(&id,nullptr,fun,nullptr);
	while(1){
		cout<<"我是主线程"<<"  "<<pthread_self()<<endl;
		sleep(1);
	}
	return 0;
}
